import request from "@/utils/request";

//调取所有文章的接口 频道新闻推荐_V1.1

export const getArticles = (params) => {
    return request({
        url: '/v1_0/articles',
        params
    })
}

//调取文章详情的接口
export const getArticleById = id => {
    return request({
        url:`/v1_0/articles/${id}`
    })
}

//调取文章收藏接口
export const addCollect = id => {
    return request({
        method: 'POST',
        url: '/v1_0/article/collections',
        data: {
            target:id
       }
    })
}

//调取取消文章收藏接口
export const deleteCollect = id => {
    return request({
        method: 'DELETE',
        url: `/v1_0/article/collections/${id}`
    })
}

//调取点赞接口
export const addLink = id => {
    return request({
        method: 'POST',
        url: '/v1_0/article/likings',
        data: {
            target:id
        }
    })
}

//调取取消点赞接口
export const deleteLink = id => {
    return request({
        method: 'DELETE',
        url: `/v1_0/article/likings/${id}`
    })
}